#set(CMAKE_CXX_FLAGS "-gdwarf-2 -g -O2")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -std=c++17 -pthread")
#SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_BUILD_TYPE Debug)
#ignore ._xxxxx.cpp  
 
#add_definitions(-DLOGIN_SERVER)

#option(TARS_MYSQL "option for mysql" ON)
#include (/usr/local/tars/cpp/makefile/tars-tools.cmake)

file(GLOB_RECURSE SOURCES_CORE ../net/[^.]*.cc ../net/[^.]*.h)
file(GLOB_RECURSE SOURCES_UTIL ../utils/[^.]*.cc ../utils/[^.]*.h)
file(GLOB_RECURSE SOURCES_TEST [^.]*.cc [^.]*.h)
#file(GLOB_RECURSE sources_TARS ../tars/[^.]*.cpp ../tars/[^.]*.h)
#file(GLOB_RECURSE sources_SHARE_DATA ../share/data/[^.]*.cpp ../share/data/[^.]*.h)

set(TCP_SERVER_SRC
  ${SOURCES_CORE}
  ${SOURCES_UTIL}
  ${SOURCES_TEST}
) 
 
#message(status " This is the server_share srcs:" ${sources_SERVER_SHARE})
#message(status " This is the share srcs:" ${sources_SHARE})
#message(status " This is the share data srcs:" ${sources_SHARE_DATA})
message(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../net
  ${CMAKE_CURRENT_SOURCE_DIR}/../net/inner
  ${CMAKE_CURRENT_SOURCE_DIR}/../net/inner/poller
  ${CMAKE_CURRENT_SOURCE_DIR}/../utils
  ${CMAKE_CURRENT_SOURCE_DIR}/../utils/crypto
#  ${CMAKE_CURRENT_SOURCE_DIR}/../tars/
  /usr/include
#  /usr/local/tars/cpp/thirdparty/include
) 

LINK_DIRECTORIES(
  /usr/local/lib
#  /usr/local/tars/cpp/thirdparty/lib 
)

#gen_server(ServiceController Loginserver)

add_executable(tcp_server_test ${TCP_SERVER_SRC})
#target_link_libraries(Loginserver mysqlclient)
target_link_libraries(tcp_server_test pthread)
#target_link_libraries(Loginserver crypto) 
#target_link_libraries(Loginserver ${LIB_TARS_SERVANT} ${LIB_TARS_UTIL})
 